home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1996 November
/
Chip 11-96.iso
/
treiber
/
grafik
/
datapat
/
twinor64
/
win3x
/
blackole
/
bheffect.h_
/
bheffect.h
Wrap
C/C++ Source or Header
|
1994-07-03
|
12KB
|
180 lines
/* ========================================================================= */
/* == == */
/* == Black Holes V2.00, Warp effects DLL Interface == */
/* == == */
/* == (c) Datapath UK Ltd, Derby. == */
/* == Last modified : July 1994 == */
/* == == */
/* == Developers are free to use this interface to add their own warp == */
/* == visual effects. The mechanism for doing this is explained fully == */
/* == in the Black Holes online help file. The basic steps are: == */
/* == == */
/* == Warp visual effects are placed in a separate DLL - there can be == */
/* == more than one effect in a single DLL. Each DLL must provide the == */
/* == two exported routines : == */
/* == 1. unsigned short BHGetNumberOfEffects (void); == */
/* == 2. void BHGetEffectsDetails (PTBHEffectDetails); == */
/* == == */
/* == The first simply tells Black holes how many visual effects are == */
/* == contained within the DLL. == */
/* == The second fills in an array of TBHEffectDetails with the details == */
/* == of each effect in the DLL. See later for a description of the == */
/* == contents of TBHEffectDetails. == */
/* == == */
/* == Place the name of the finished effects DLL in the [DLLs] section == */
/* == of the Black Holes INI file (blackole.ini). == */
/* == eg : == */
/* == == */
/* == [DLLs] == */
/* == ; list of visual effects dll's == */
/* == bheffect.dll == */
/* == your_dll.dll == */
/* == == */
/* == The actual DLL should be placed in one of the following == */
/* == directories : == */
/* == 1. The Black Holes directory ( probably \BLACKOLE ) == */
/* == 2. The Windows directory ( \WINDOWS ) == */
/* == 3. The Windows System directory ( \WINDOWS\SYSTEM ) == */
/* == == */
/* ========================================================================= */
#ifndef _BHEFFECT_DEF_
#define _BHEFFECT_DEF_
#ifdef __DLL__
#define EXPORT_FN _export
#else
#define EXPORT_FN
#endif
#include <windows.h>
#ifdef __cplusplus
extern "C" {
#endif
/* ========================================================================== */
/* == Configuration data type for warp effect == */
/* == Each warp effect can use this type to store whatever configuration == */
/* == data it wants, but - == */
/* == == */
/* == DO NOT use it to store pointer values - the value gets written == */
/* == into the .BKH files, and the .INI file, so using a pointer value == */
/* == would cause a crash when Black Holes is run for a second time. == */
/* == == */
/* == This effectively restricts the configuration data to 4 bytes. == */
/* == Datapath Ltd reserve the right to change the TConfigData type to == */
/* == allow more information to be stored in the future. == */
/* ========================================================================== */
typedef unsigned long TConfigData;
/* ========================================================================== */
/* == Structure holding start and end points (in screen coordinates) for == */
/* == a cursor warp. == */
/* ========================================================================== */
typedef struct { POINT start;
POINT end;
} TWarpPoints;
typedef TWarpPoints FAR * PTWarpPoints;
/* ========================================================================== */
/* == Structure to hold effect details for each individual warp effect == */
/* == == */
/* == effect_name : Name of effect as presented to user == */
/* == is_configurable : Whether it is possible to 'setup' the == */
/* == effect. If this is TRUE, then 'Configure' (see == */
/* == later) must not be NULL == */
/* == init_config_data : Holds the initial 'config' value of the == */
/* == effect == */
/* == (*Configure) : Points to a function which alters the config == */
/* == data for the particular effect == */
/* == == */
/* == == */
/* == (*InitialiseEffect): This is called once, when Black Holes first == */
/* == starts up. This allows one-time initialisation, == */
/* == or the possibility, say, of putting up your own == */
/* == splash panel saying who wrote the new effects. == */
/* == == */
/* == (*FreeEffect) : This is called once, when Black Holes is == */
/* == closing down. == */
/* == == */
/* == BeginEffect, DoEffect, EndEffect - the routines that actually == */
/* == warp the cursor from one hole to another. They are called one == */
/* == after each other, each one with the same parameters : == */
/* == == */
/* == PTWarpPoints pts : points to a structure containing the start == */
/* == and end points of the warp, in screen coords == */
/* == HWND hwnd : Window handle of the Black Hole located at == */
/* == the entry point. == */
/* == TConfigData config : the config value to be used for the warp == */
/* == LPDWORD user_data : pointer to a DWORD, where the developer can == */
/* == store any extra data desired. The same value == */
/* == is passed to BeginEffect, DoEffect & == */
/* == EndEffect by Black Holes. == */
/* == The value of user_data is not stored in the == */
/* == .BKH or .INI files. == */
/* == == */
/* == (*BeginEffect) : Called immediately before a cursor warp == */
/* == happens, allows any 'setting up' to be done. == */
/* == (*DoEffect) : This function warps the cursor between the == */
/* == start and end points supplied in PTWarpPoints == */
/* == (*EndEffect) : Called immediately after the warp has been == */
/* == completed, and allows any 'tidying up' to be == */
/* == done. == */
/* == == */
/* == number_of_cursors : Holds the number of different cursors the == */
/* == uses == */
/* == == */
/* == (*LoadCursor) : Loads the cursors required for the effect, == */
/* == into an array of HCURSORs, the size of which is == */
/* == defined by 'number_of_cursors' field above. == */
/* == Returns the number of cursors loaded. == */
/* == == */
/* == (*SelectCursor) : This routine is called when the mouse cursor == */
/* == moves over a Black Hole with this effect. == */
/* == Given the start and end warp points, returns == */
/* == the index of the cursor to display. The index == */
/* == should be an integer between 0 and the number == */
/* == given by number_of_cursors minus 1 (see above). == */
/* == == */
/* ========================================================================== */
#define MAX_EFFECTNAME_LENGTH 20
typedef struct { void (*Configure) (TConfigData FAR *, HWND);
void (*InitialiseEffect) (void);
void (*FreeEffect) (void);
void (*BeginEffect) (PTWarpPoints, HWND, TConfigData, LPDWORD);
void (*DoEffect) (PTWarpPoints, HWND, TConfigData, LPDWORD);
void (*EndEffect) (PTWarpPoints, HWND, TConfigData, LPDWORD);
unsigned short (*LoadCursors) (HCURSOR far *);
unsigned short (*SelectCursor)(PTWarpPoints);
TConfigData init_config_data;
BOOL is_configurable;
unsigned short number_of_cursors;
char effect_name[MAX_EFFECTNAME_LENGTH];
} TBHEffectDetails, FAR * PTBHEffectDetails;
/* ========================================================================== */
/* == Returns the number of warp effects in the file == */
/* ========================================================================== */
unsigned short CALLBACK EXPORT_FN BHGetNumberOfEffects (void);
/* ========================================================================== */
/* == Fills the 'details' structure for the number of effects given by == */
/* == BHGetNumberOfEffects (see above). == */
/* ========================================================================== */
void CALLBACK EXPORT_FN BHGetEffectsDetails(PTBHEffectDetails details);
#ifdef __cplusplus
}
#endif
#endif